#ifndef __IMU_H
#define __IMU_H


#include "stm32f1xx_hal.h"
#include "stdint.h"
#include "ringbuffer.h"

#define IMU_BUFFER_LEN 128U

typedef struct _imu_t
{
	ring_buf_t imu_rb;
	uint8_t init_state; //初始化状态

	/* 处理中间值 */
	uint8_t buff[IMU_BUFFER_LEN];
	uint8_t size;

	//角度值
	float roll_x;
	float pitch_y;
	float yaw_z;
} imu_t;

extern imu_t imu;
extern void imu_init(void);
extern void imu_recv_handle(void);

#endif

